<!--
 * @Author: your name
 * @Date: 2021-05-28 11:23:33
 * @LastEditTime: 2021-06-01 15:21:17
 * @LastEditors: helei
 * @Description: In User Settings Edit
 * @FilePath: \tourismpc\src\views\panda\components\headlines\headlines.vue
-->
<template>
  <div class="panda">
    <div class="pandaList">
      <div class="listItem" v-for="i in carousel" :key="i.pandaId" @click="goDetail(i.pandaId)">
        <div class="img">
          <img :src="i.titleImgUrl" alt="" />
        </div>
        <div class="text">
          <div class="hederText">
            <div class="title">
              {{ i.titleName }}
            </div>
          </div>
          <div class="timeText">{{i.publisherName}} {{i.pandaTime}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Headlines",
  props: ["carousel"],
  methods: {
    goDetail(id) {
      this.$router.push({
        path: "/panda/headlines",
        query: {
          id,
        },
      });
    },
  },
};
</script>
<style lang="less">
.panda {
  .pandaList {
    overflow: hidden;
  }
  .listItem {
    width: 380px;
    float: left;
    border: 1px solid #dddddd;
    margin-bottom: 30px;
    cursor: pointer;
    margin-right: 37px;
    &:nth-child(3n) {
      margin-right: 0;
    }
    .img {
      height: 280px;
      box-sizing: border-box;
      img {
        width: 100%;
        height: 100%;
      }
      border-bottom: 1px solid #dddddd;
    }
    .text {
      .hederText {
        padding: 22px 11px 14px 11px;
        overflow: hidden;
        .title {
          float: left;
          height: 28px;
          display: flex;
          align-items: flex-end;
          color: #333333;
        }
      }
      .timeText {
        margin: 0 22px 14px 22px;
        font-size: 14px;
        max-height: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #666666;
        text-align: right;
      }
    }
  }
}
</style>